package org.syncsoft.overalt.domain.user.entity;

import org.apache.commons.lang.StringEscapeUtils;
import org.syncsoft.overalt.domain.common.entity.IEntity;

/**
 * Class of domain that represents the a.m.i.g.o.s. user
 * @author hfa
 *
 */

public class User implements IEntity {
	private int code;
	private String shortName;
	
	public User() {
		
	}
	
	public User(int code) {
		this.code = code;
	}
	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getShortName() {
		return shortName;
	}
	public void setShortName(String shortName) {
		this.shortName = StringEscapeUtils.unescapeHtml(shortName);
	}
	
	@Override
	public String toString() {
		return getShortName();
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof User && ((User)obj).getCode() == getCode()) {
			return true;
		}
		return false;
	}
}
